import React from 'react';
import {Routes,Route} from "react-router-dom";
import Index from "../pages/Index";
import NotFound from "../pages/NotFound";
import Login from "../pages/Login";
import Details from "../pages/Details";
import NewsList from "../pages/NewsList";
import Search from "../pages/Search";
import My from "../pages/My";
import AuthComponent from "../components/AuthComponent";




function index(props) {
    return (
        <Routes>
            <Route path={'/'} element={<Index/>}>
                <Route index element={<NewsList/>}/>
                <Route path={'search'} element={<AuthComponent><Search/></AuthComponent>}/>
                <Route path={'my'} element={<AuthComponent><My/></AuthComponent>}/>
            </Route>
            <Route path={'/login'} element={<Login/>}/>
            <Route path={'/details/:id.html'} element={<Details/>}/>
            <Route path={'*'} element={<NotFound/>}/>
        </Routes>
    );
}

export default index;